home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / html / StyleSheet$SearchBuffer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.7 KB  |  69 lines

  1. package javax.swing.text.html;
  2.  
  3. import java.util.EmptyStackException;
  4. import java.util.Hashtable;
  5. import java.util.Stack;
  6. import java.util.Vector;
  7.  
  8. class StyleSheet$SearchBuffer {
  9.    static Stack searchBuffers = new Stack();
  10.    Vector vector = null;
  11.    StringBuffer stringBuffer = null;
  12.    Hashtable hashtable = null;
  13.  
  14.    void empty() {
  15.       if (this.stringBuffer != null) {
  16.          this.stringBuffer.setLength(0);
  17.       }
  18.  
  19.       if (this.vector != null) {
  20.          this.vector.removeAllElements();
  21.       }
  22.  
  23.       if (this.hashtable != null) {
  24.          this.hashtable.clear();
  25.       }
  26.  
  27.    }
  28.  
  29.    Hashtable getHashtable() {
  30.       if (this.hashtable == null) {
  31.          this.hashtable = new Hashtable();
  32.       }
  33.  
  34.       return this.hashtable;
  35.    }
  36.  
  37.    StringBuffer getStringBuffer() {
  38.       if (this.stringBuffer == null) {
  39.          this.stringBuffer = new StringBuffer();
  40.       }
  41.  
  42.       return this.stringBuffer;
  43.    }
  44.  
  45.    Vector getVector() {
  46.       if (this.vector == null) {
  47.          this.vector = new Vector();
  48.       }
  49.  
  50.       return this.vector;
  51.    }
  52.  
  53.    static StyleSheet$SearchBuffer obtainSearchBuffer() {
  54.       StyleSheet$SearchBuffer var0;
  55.       try {
  56.          var0 = (StyleSheet$SearchBuffer)searchBuffers.pop();
  57.       } catch (EmptyStackException var1) {
  58.          var0 = new StyleSheet$SearchBuffer();
  59.       }
  60.  
  61.       return var0;
  62.    }
  63.  
  64.    static void releaseSearchBuffer(StyleSheet$SearchBuffer var0) {
  65.       var0.empty();
  66.       searchBuffers.push(var0);
  67.    }
  68. }
  69.